-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Add address bar trackers animation #6904
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Add address bar trackers animation #6904
Conversation
These were deleted in the omnibar cleanup so adding them back with a new name
…stency We no longer use the startExperimentVariant1Animation and we can rename the function we will be using so it's clearer it's not an experiment
The text is now moved to scenes which we'll utilise in a later commit. These will added to the OmnibarLayout just as the Cookies animation is
We don't need this anymore, we can do what we need in the VM
…ogic This moves the former experimental trackers animation to it's new state where it mimics the Cookies animation by sliding out but retains it's count up behaviour from the original. We moved to this style to maintain consistency with the animations here We added some new behaviour in the TrackerCountAnimator which means we only animate the count up if we have greater than 4 trackers, otherwise we wait and the end the animation. We need to expose getTrackerAnimationStartCount so that it's possible to set the correct widths for the trackers count TextViews We'll tidy up the BrowserLottieTrackersAnimatorHelper in a later commit but I wanted to leave this as is so you can see the previous experiment behaviour
If we're happy with how this rolls out we'll be able to remove protected and dark shield
Matches the behaviour we had in the commented section before that we deleted in a previous commit, but now accounts for the newly added `if(!currentBrowserViewState().maliciousSiteBlocked` by moving the logic to the VM
- Extract AddressBarTrackersAnimator from BrowserLottieTrackersAnimatorHelper - Create CommonAddressBarAnimationHelper for shared animation utilities - Consolidate duplicate fade in/out animation methods - Move classes to an addressbar package - Remove redundant experiment code
I found the name of this function confusing as it does more than just the trackers animation, it cancels the cookies animation too
This will also fix the same issue that happens with the current cookies animation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR introduces a new address bar trackers animation feature that replaces the previous trackers animation with a slide-in/slide-out style animation similar to the cookies animation. The animation displays tracker count with a counting effect and shows a shield icon pop animation when enabled through a feature toggle.
Key Changes
- Added new address bar trackers animation components with sliding text and count animations
- Implemented feature toggle system to control when the new animation is used
- Updated existing animation infrastructure to support the new address bar animation style
Reviewed Changes
Copilot reviewed 24 out of 25 changed files in this pull request and generated 3 comments.
Show a summary per file
File | Description |
---|---|
TrackerCountAnimatorTest.kt |
Added comprehensive test coverage for tracker count animation logic |
OmnibarLayoutViewModelTest.kt |
Updated test method name for animation cancellation |
address_bar_trackers_animation_shield.json |
New Lottie animation asset for shield pop effect |
view_single_omnibar.xml |
Added new shield animation view and updated layout constraints |
address_bar_trackers_animation_scene_*.xml |
New layout files for animation scenes with tracker text and count views |
TrackersRenderer.kt |
Moved to addressbar package for better organization |
TrackerCountAnimator.kt |
New component implementing tracker count animation with threshold-based logic |
AddressBarTrackersAnimator.kt |
Main animator class orchestrating the complete address bar trackers animation |
BrowserLottieTrackersAnimatorHelper.kt |
Updated to integrate new address bar animation system |
LottiePrivacyShieldAnimationHelper.kt |
Added feature toggle integration for shield animation selection |
OmnibarLayout.kt |
Updated to use new animation system when feature toggle is enabled |
AddressBarTrackersAnimationFeatureToggle.kt |
Added internal always enabled flag for feature toggle |
BrowserTabViewModel.kt |
Added logic to enqueue cookies animation when new feature is enabled |
...c/main/java/com/duckduckgo/app/browser/omnibar/animations/addressbar/TrackerCountAnimator.kt
Show resolved
Hide resolved
.../java/com/duckduckgo/app/browser/omnibar/animations/addressbar/AddressBarTrackersAnimator.kt
Show resolved
Hide resolved
.../duckduckgo/app/browser/omnibar/animations/addressbar/BrowserLottieTrackersAnimatorHelper.kt
Show resolved
Hide resolved
The shield highlighting was slightly off in onboarding due to our new icon so we adjust margin start to account for that. While looking into it more I noticed that highlighting in tablets was completely off for the Bottom omnibar because 1. We factored in swapping top and bottom margins but we didn't adjust paddings which have been set 2. When using the Toolbar widget, we automatically get an 8dp horizontal padding given to us on device >600dp. My feeling is that this was never desired seeing as we set contentInsets to 0 so I've not set the paddingLeft and paddingRight so it's more predicatable These fixes are both for the current prod shield and with our new shield
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks and works as expected 👍
Task/Issue URL: https://app.asana.com/1/137249556945/project/1207908166761516/task/1211429464967835?focus=true
Description
This PR introduces the address bar trackers animation from the sense of protection experiment. The difference from the experiment is that we now match the cookies animation slide out/in style.
Steps to test this PR
Do a fresh install. Start in light mode.
Ensure the
addressBarTrackersAnimation
feature
toggle is on (it's on by default for internal builds)Address Bar Trackers Animation
Animation Cancellation
Misc tests
Flag off behaviour
addressBarTrackersAnimation
feature
toggle is offOnboarding Shield Highlight for New Shield
Onboarding Shield Highlight for Existing Shield
UI changes
Screen.Recording.2025-10-08.at.06.58.01.mov